WIP: [python] Introduce packages option - #768
Draft
Alexander Smolyakov (alexander-smolyakov) wants to merge 10 commits into
Draft
WIP: [python] Introduce packages option#768Alexander Smolyakov (alexander-smolyakov) wants to merge 10 commits into
packages option#768Alexander Smolyakov (alexander-smolyakov) wants to merge 10 commits into
Conversation
- Create `utils.sh` files; - Move `sudo_if` to utils.sh`; - Replace `install_user_package` with `install_python_package` and move function to utils.sh`; - Add logic to handle `packages` input;
Alexander Smolyakov (alexander-smolyakov)
requested a review
from a team
as a code owner
November 29, 2023 10:12
Samruddhi Khandale (samruddhikhandale)
left a comment
Member
There was a problem hiding this comment.
This looks amazing, thanks for adding the new Feature option. Left some minor comments.
| "default": "os-provided", | ||
| "description": "Select a Python version to install." | ||
| }, | ||
| "additionalVersions": { |
There was a problem hiding this comment.
We intentionally did not publicize this option just because it was experimental. Also, it was meant only to be used by universal image.
However, if it works great in different test scenarios then it is worth publicizing 🎉
Alexander Smolyakov (alexander-smolyakov)
marked this pull request as draft
November 30, 2023 16:51
Jeff Putsch (jdputschadi)
pushed a commit
to analogdevicesinc/devcontainers-features
that referenced
this pull request
Feb 7, 2024
Samruddhi Khandale (samruddhikhandale)
pushed a commit
that referenced
this pull request
Feb 9, 2024
* install gpg2.22 on centos 7 when installing python * RHEL support, exisiting tests pass, new RHEL tests pass. * add tests, cleanup install organization * update testing to include RHEL tests * update testing to include RHEL tests * undo addition of installing additional pip modules * fix errors installing os-provided Python on recent Debian systems and on Mariner systems * adjust to properly use newly installed python (PYTHON_SRC) instead of assuming "python" will work * When installing pipx, check if python is marked as externally managed. If so, add "--break-system-packages" to the pip install flags. This does not really breack system packages due to the setting of PYTHONUSERBASE during the install of pipx, but does get us past checks for installing python packages into the system python install. * merge from main * update check for managed python install. pass all tests. * add "packages" option from PR #768 * remove "packages" option * Address PR feedback, passes all tests locally. * fix install error on centos --------- Co-authored-by: Jeff Putsch <jputsch@analog.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
General info
Feature name:
Attached related issue:
Description:
This PR introduces a new option -
packages. The new option receives a comma-spread string as input. The input contains packages that should be installed during the feature installation process.User experience
The user can specify a package version that would be installed. Usage examples:
Example 1:
{ "ghcr.io/devcontainers/features/python:1": { "version": "3.10.12", "packages": "torch,request,aiohttp" }, }Note: In this example, the feature installs the latest versions available in PIP.
Example 2:
{ "ghcr.io/devcontainers/features/python:1": { "version": "3.10.12", "packages": "cryptography==41.0.4,urllib3==1.26.18" }, }Note: In this case, the feature install versions were explicitly pointed out in the
devcontainer.json.Installation process
The feature already contains the
install_user_packagefunction. Considering new functionality, the function should be updated, and the installation process should be split into two steps:The installation folder will be resolved based on the user under which the feature is installed:
site-packagesfolder;site-packagesfolder;Changelog
Added info about
packagesandadditionalVersionsinputs;Introduced the
packagesoption:packagesinput;install_python_packagefunction to replace theinstall_user_packagefunction;sudo_iffunction moved to theutils.shfile;Added tests to cover new functionality;
Checklist: